package com.keqiongzc.module_login

import androidx.lifecycle.MutableLiveData
import com.everyline.lib_base.base.BaseViewModel
import com.everyline.lib_base.ext.request
import com.everyline.lib_base.state.ResultState
import com.everyline.lib_common.bean.UserInfoBean
import com.everyline.lib_common.net.HttpRequestManger


/**
 * Created by on 2020/12/1.
 * 天天挂线
 *  746608431@qq.com
 *  描述:TODO
 */

class RequestLoginCodeModel : BaseViewModel() {

    var codeData = MutableLiveData<ResultState<String?>>()

    var userBeanData = MutableLiveData<ResultState<UserInfoBean?>>()
    var userBeanTokenData = MutableLiveData<ResultState<UserInfoBean?>>()


    fun sendSmsCode(map: Map<String, String>) {

        request({ HttpRequestManger.apiService.sendSmsCode(map) }, codeData, false)

    }

    fun driverLoginByMobile(map: Map<String, String>) {
        request({ HttpRequestManger.apiService.driverLoginByMobile(map) }, userBeanData, true)

    }


}